inherited fmPaymentsCopy: TfmPaymentsCopy
  Left = 348
  Top = 203
  Width = 801
  Height = 513
  Caption = 'fmPaymentsCopy'
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 452
    Width = 793
  end
  inherited Panel1: TPanel
    Width = 793
    inherited BitBtn1: TBitBtn
      Left = 623
    end
    inherited BitBtn2: TBitBtn
      Left = 711
    end
  end
  object cxGrid3: TcxGrid [2]
    Left = 0
    Top = 45
    Width = 793
    Height = 407
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 2
    TabStop = False
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView3: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = True
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = True
      NavigatorButtons.Edit.Visible = True
      NavigatorButtons.Post.Visible = True
      NavigatorButtons.Cancel.Visible = True
      NavigatorButtons.Refresh.Visible = True
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dsVizit
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      DateTimeHandling.HourFormat = 'hh:mm'
      OptionsBehavior.CellHints = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsData.Appending = True
      OptionsView.Navigator = True
      OptionsView.NavigatorOffset = 10
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.ShowEditButtons = gsebAlways
      OptionsView.CellAutoHeight = True
      OptionsView.ColumnAutoWidth = True
      OptionsView.Footer = True
      OptionsView.FooterAutoHeight = True
      OptionsView.FooterMultiSummaries = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Preview.Visible = True
      object cxGridDBTableView3PID_POLUCH: TcxGridDBColumn
        DataBinding.FieldName = 'PID'
        PropertiesClassName = 'TcxLookupComboBoxProperties'
        Properties.KeyFieldNames = 'PID'
        Properties.ListColumns = <
          item
            FieldName = 'PLASTNAME'
          end
          item
            FieldName = 'PNAME'
          end
          item
            FieldName = 'PPATRONYMIC'
          end
          item
            Fixed = True
            Sorting = False
            FieldName = 'PDATEBIRTH'
          end
          item
            FieldName = 'SDNAME'
          end>
        Properties.ListSource = dsPeople
        Width = 229
      end
      object cxGridDBTableView3CSID: TcxGridDBColumn
        DataBinding.FieldName = 'CSID'
        Width = 66
      end
      object cxGridDBTableView3LASTNAME: TcxGridDBColumn
        DataBinding.FieldName = 'LASTNAME'
        SortIndex = 0
        SortOrder = soDescending
        Width = 59
      end
      object cxGridDBTableView3NAME: TcxGridDBColumn
        DataBinding.FieldName = 'NAME'
        Width = 79
      end
      object cxGridDBTableView3AMOUNT: TcxGridDBColumn
        DataBinding.FieldName = 'AMOUNT'
        Width = 112
      end
      object cxGridDBTableView3TYPE: TcxGridDBColumn
        DataBinding.FieldName = 'TYPE'
        Width = 71
      end
      object cxGridDBTableView3DATA: TcxGridDBColumn
        DataBinding.FieldName = 'DATA'
        Width = 75
      end
      object cxGridDBTableView3NOTE1: TcxGridDBColumn
        DataBinding.FieldName = 'NOTE1'
        Width = 88
      end
      object cxGridDBTableView3NOTE2: TcxGridDBColumn
        DataBinding.FieldName = 'NOTE2'
        Width = 39
      end
    end
    object cxGridLevel3: TcxGridLevel
      GridView = cxGridDBTableView3
    end
  end
  object dsVizit: TDataSource
    DataSet = qPayments
    Left = 16
    Top = 56
  end
  object qPayments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT CAST ('#39'0'#39' AS varchar(255)) AS pp, p.*,  CAST ('#39'0'#39' AS inte' +
        'ger) AS pid'
      'FROM "pay5" p'
      'WHERE NOT EXISTS'
      '('
      'SELECT cs.CSID'
      'FROM COMMON_SERV cs'
      'WHERE cs.CSID = CAST(p.CSID AS INTEGER)'
      ')'
      '--AND NOT(p.NOTE2 CONTAINING '#39#1072#1088#1077#1085#1076#1072' '#1093#1086#1088'. '#1079#1072#1083#1072#39')')
    UpdateObject = IBUpdateSQL1
    GeneratorField.Field = 'PVID'
    GeneratorField.Generator = 'GEN_P_VIZIT_ID'
    Left = 48
    Top = 56
    object qPaymentsCSID: TIBStringField
      FieldName = 'CSID'
      Origin = '"pay4"."CSID"'
      Size = 10
    end
    object qPaymentsLASTNAME: TIBStringField
      FieldName = 'LASTNAME'
      Origin = '"pay4"."LASTNAME"'
      Size = 25
    end
    object qPaymentsNAME: TIBStringField
      FieldName = 'NAME'
      Origin = '"pay4"."NAME"'
      Size = 25
    end
    object qPaymentsAMOUNT: TIBStringField
      FieldName = 'AMOUNT'
      Origin = '"pay4"."AMOUNT"'
      Size = 24
    end
    object qPaymentsDATA: TIBStringField
      FieldName = 'DATA'
      Origin = '"pay4"."DATA"'
      Size = 22
    end
    object qPaymentsPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 255
    end
    object qPaymentsPID: TIntegerField
      FieldName = 'PID'
      ProviderFlags = []
    end
    object qPaymentsCSFORM: TIBStringField
      FieldName = 'CSFORM'
      Origin = '"pay5"."CSFORM"'
      Size = 18
    end
    object qPaymentsFORWHAT: TIBStringField
      FieldName = 'FORWHAT'
      Origin = '"pay5"."FORWHAT"'
      Size = 31
    end
    object qPaymentsNOTE: TIBStringField
      FieldName = 'NOTE'
      Origin = '"pay5"."NOTE"'
      Size = 86
    end
  end
  object dsPeople: TDataSource
    DataSet = qPeople
    Left = 80
    Top = 112
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL AND sd.SDID = 1246'
      'ORDER BY 3')
    Left = 112
    Top = 112
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      DisplayWidth = 20
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPeopleSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object IBUpdateSQL1: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PP,'
      '  CSID,'
      '  LASTNAME,'
      '  NAME,'
      '  AMOUNT,'
      '  TYPE,'
      '  DATA,'
      '  NOTE1,'
      '  NOTE2,'
      '  PID'
      'from pay4 '
      'where'
      '  CSID = :CSID')
    ModifySQL.Strings = (
      'update pay4'
      'set'
      '  AMOUNT = :AMOUNT,'
      '  CSID = :CSID,'
      '  DATA = :DATA,'
      '  LASTNAME = :LASTNAME,'
      '  NAME = :NAME,'
      '  NOTE1 = :NOTE1,'
      '  NOTE2 = :NOTE2,'
      '  PID = :PID,'
      '  PP = :PP,'
      '  TYPE = :TYPE'
      'where'
      '  CSID = :OLD_CSID')
    InsertSQL.Strings = (
      'insert into pay4'
      
        '  (AMOUNT, CSID, DATA, LASTNAME, NAME, NOTE1, NOTE2, PID, PP, TY' +
        'PE)'
      'values'
      
        '  (:AMOUNT, :CSID, :DATA, :LASTNAME, :NAME, :NOTE1, :NOTE2, :PID' +
        ', :PP, '
      '   :TYPE)')
    DeleteSQL.Strings = (
      'delete from pay4'
      'where'
      '  CSID = :OLD_CSID')
    Left = 80
    Top = 56
  end
  object qPlatInsert: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'INSERT INTO COMMON_SERV (csid, pid_poluch, csform, CSamount, csd' +
        'ate, csforwhat, csnote)'
      
        'VALUES (:csid, :pid_poluch, :csform, :CSamount, :csdate, :csforw' +
        'hat, :csnote)')
    Left = 80
    Top = 152
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'csid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid_poluch'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'csform'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CSamount'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'csdate'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'csforwhat'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'csnote'
        ParamType = ptUnknown
      end>
  end
end
